<?php

namespace app\common\model;

use think\Model;

/**
 * 学校
 */
class School extends Model
{
    protected $connection = 'db2';
    protected $name = 'school';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'created_at';
    protected $updateTime = false;

    const NORMAL = 'normal';
    const HIDDEN = 'hidden';

    public function classes()
    {
        return $this->hasMany(Classes::class);
    }

    public function student()
    {
        return $this->hasMany(Student::class);
    }

    public function teacher()
    {
        return $this->hasMany(Teacher::class);
    }




}
